package com.paiai.lslease.service.apphouse;

import com.paiai.lslease.auto.model.AppLock;
import com.paiai.lslease.auto.model.AppLockTenant;
import com.paiai.lslease.model.AppLockInfo;

import java.sql.SQLException;
import java.util.List;

public interface AppLockService {
    /**
     * 房源下新增一个设备
     */
    AppLock insertLock(AppLock appLock) throws Exception;

    /**
     * 房源下删除一个设备
     */
    boolean deleteLockById(int lockId) throws Exception;

    /**
     * 修改房源下的一个设备
     */
    AppLock modifyLock(AppLock appLock) throws Exception;

    /**
     * 查询房源下的所有设备
     */
    List<AppLockInfo> selectHouseAllLock(int houseId) throws Exception;

    /**
     * 查询用户的所有设备
     */
    List<AppLock> selectUserAllDevice(int userId) throws Exception;

    /**
     * 查询单个设备
     */
    AppLock selectLockById(int lockId) throws Exception;

    /**
     * 检查设备是否存在
       */
    boolean lockExistById(int lockId) throws Exception;

    /**
     * 查询房东单纯作为房东角色的所有设备
     */
    List<AppLock> selectOnlyLandlordAllLock(int landlordId) throws Exception;

    /**
     * 查询房东所有的租客
     */
    List<AppLockTenant> selectLandlordAllLockTenant(int landlordId) throws Exception;

    /**
     * 设备是否属于该房东
     *
     */
    boolean lockBelongLandlord(int lockId, int landlordId) throws Exception;

    /**
     * 设备是否属于该用户
     *
     */
    boolean lockBelongUser(int lockId, int userId) throws Exception;

    /**
     * 租客是否属于该房东
     */
    boolean lockTenantBelongLandlord(int lockTenantId, int landlord) throws Exception;

    /**
     * 设备是否属于该房源
     */
    boolean lockBelongHouse(int lockId, int houseId) throws Exception;

    /**
     * 房源下是否已添加该设备
     */
    boolean lockExistByHouseIdAndLockMac(int houseId, String lockMac) throws Exception;
}
